package pers.linkong.asr.util;




    /**
    * @ClassName: StringKit
    * @Description: TODO(字符串工具包)
    * @author 独木林空
    * @date 2018年8月7日
    *
    */
    
public class StringKit {
	
	// 处理某个数字是否在"n1-n2,n3-n4,n5-n6,..."这种格式等等字符串中间
	public static ResultInfo selectNumInStr(String str, int number) {
		String s[] = str.split(",");
		for (String Str : s) {
			System.out.println(Thread.currentThread().getStackTrace()[1].getClassName() + "：" + "正在检查" + Str
					+ "是否包含" + number);
			String week[] = Str.split("-");
			if (Integer.parseInt(week[0]) <= number
					&& number <= Integer.parseInt(week[1])) {
				System.out.println(Thread.currentThread().getStackTrace()[1].getClassName() + "：" + "成功：" + week[0] + "<=" + number + "<="
						+ week[1]);
				return ResultInfo.data(1, "成功，此字符串包含本数字");
			}
		}
		return ResultInfo.data(0, "错误，此字符串不包含本数字");
	}

}
